home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD ROM Paradise Collection 4
/
CD ROM Paradise Collection 4 1995 Nov.iso
/
program
/
swagd_f.zip
/
DRIVES.SWG
/
0094_Checking Drive Ready.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1995-02-28
|
774b
|
50 lines
{
checking for drive ready?
Here's something that I fiddled arround. It is still noisy but
thought you may want to see it.
}
uses
Crt, Dos;
function DriveReady(Drive : Byte) : Boolean; assembler;
{ a=0, b=1, etc. Shouldn't work at all on hard drives !! }
var
Buffer : array[1..512] of Byte;
N : Byte;
asm
mov [N],3 { retry 3 times }
@10:
mov ax,$0401
mov cx,$0001
mov dh,$00
mov dl,[Drive]
push ss
pop es
lea bx,[Buffer]
int $13
mov al,FALSE
jnc @20
dec [N]
jnz @10
jmp @30
@20:
or ah,ah
jnz @30
mov al,TRUE
@30:
end;
begin
ClrScr;
repeat
writeln(^G'Drive Ready = ', DriveReady(0));
Mem[$40:$40]:=255;
Delay(2000);
until (KeyPressed);
Mem[$40:$40]:=1; { shut motors }
end.